import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/home/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/home',
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/newhot',
      name: 'newhot',
      component: () => import('@/views/home/hotandnew/HotAndNew.vue'),
    },

    {
      path: '/topic',
      name: 'topic',
      component: () => import('@/views/topic/TopicView.vue'),
    },
    {
      path: '/topicdetail',
      name: 'topicdetail',
      component: () => import('@/views/topic/DetailView.vue'),
    },
    {
      path: '/category',
      name: 'category',
      component: () => import('@/views/category/CategoryView.vue'),
    },
    {
      path: '/subcategory',
      name: 'subcategory',
      component: () => import('@/views/category/SubCategory.vue'),
    },
    {
      path: '/cart',
      name: 'cart',
      component: () => import('@/views/cart/CartView.vue'),
    },
    {
      path: '/mine',
      name: 'mine',
      component: () => import('@/views/mine/MineView.vue'),
    },
    {
      path: '/searchgoods',
      name: 'SerachGoods',
      component: () => import('@/views/goodsSearch/GoodsSearch.vue'),
    },
    {
      path: '/goodsdetail',
      name: 'GoodsDetail',
      component: () => import('@/views/goodsDetail/GoodsDetail.vue'),
    },
  ],
})

export default router
